Skip to content

chore: remove as_any from aggregate and window functions#21209

Merged
timsaucer merged 9 commits intoapache:mainfrom
timsaucer:feat/remove-as-any-agg-window
Mar 30, 2026
Merged

chore: remove as_any from aggregate and window functions#21209
timsaucer merged 9 commits intoapache:mainfrom
timsaucer:feat/remove-as-any-agg-window

Conversation

@timsaucer
Copy link
Copy Markdown
Member

Which issue does this PR close?

This is a follow on to #20812 but treats aggregate and window functions.

Rationale for this change

This PR reduces the amount of boilerplate code that users need to write for aggregate and window functions.

What changes are included in this PR?

Now that we have trait upcasting since rust 1.86, we no longer need every implementation of these functions to have the as_any function that returns &self. This PR makes Any an supertrait and makes the appropriate casts when necessary.

Are these changes tested?

Existing unit tests.

Are there any user-facing changes?

Yes, the users simply need to remove the as_any function. The upgrade guide is updated.

@timsaucer timsaucer self-assigned this Mar 27, 2026
@timsaucer timsaucer added the api change Changes the API exposed to users of the crate label Mar 27, 2026
@github-actions github-actions bot added documentation Improvements or additions to documentation logical-expr Logical plan and expressions optimizer Optimizer rules core Core DataFusion crate proto Related to proto crate functions Changes to functions implementation ffi Changes to the ffi crate spark labels Mar 27, 2026
@github-actions github-actions bot added the physical-expr Changes to the physical-expr crates label Mar 27, 2026
@timsaucer
Copy link
Copy Markdown
Member Author

Thank you @xudong963 !

@timsaucer timsaucer added this pull request to the merge queue Mar 30, 2026
Merged via the queue into apache:main with commit 14a85fa Mar 30, 2026
35 checks passed
@timsaucer timsaucer deleted the feat/remove-as-any-agg-window branch March 30, 2026 20:20
github-merge-queue bot pushed a commit that referenced this pull request Apr 3, 2026
## Which issue does this PR close?

This is a follow on to #20812 and #21209 but treats `ExecutionPlan`.

## Rationale for this change

This PR reduces the amount of boilerplate code that users need to write
for execution plans.

## What changes are included in this PR?

Now that we have [trait
upcasting](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/) since
rust 1.86, we no longer need every implementation of these functions to
have the as_any function that returns &self. This PR makes Any an
supertrait and makes the appropriate casts when necessary.

I have also implemented functions `is` and `downcast_ref` on the trait
object for ExecutionPlan and applied this same pattern to the udf, udaf,
and udwf implementations. This allows for a clean downcasting and type
checking.

## Are these changes tested?

Existing unit tests.

## Are there any user-facing changes?

Yes, the users simply need to remove the `as_any` function. The upgrade
guide is updated.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
github-merge-queue bot pushed a commit that referenced this pull request Apr 12, 2026
…d CatalogProviderList (#21346)

## Which issue does this PR close?

This is a follow on to #20812 #21209 #21263 but treats `TableProvider`,
`SchemaProvider`, `CatalogProvider`, and `CatalogProviderList`.

## Rationale for this change

This PR reduces the amount of boilerplate code that users need to write
for catalogs through table providers.

## What changes are included in this PR?

Now that we have [trait
upcasting](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/) since
rust 1.86, we no longer need every implementation of these functions to
have the as_any function that returns &self. This PR makes Any an
supertrait and makes the appropriate casts when necessary.

## Are these changes tested?

Existing unit tests.

## Are there any user-facing changes?

Yes, the users simply need to remove the `as_any` function. The upgrade
guide is updated.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
coderfender pushed a commit to coderfender/datafusion that referenced this pull request Apr 14, 2026
…d CatalogProviderList (apache#21346)

## Which issue does this PR close?

This is a follow on to apache#20812 apache#21209 apache#21263 but treats `TableProvider`,
`SchemaProvider`, `CatalogProvider`, and `CatalogProviderList`.

## Rationale for this change

This PR reduces the amount of boilerplate code that users need to write
for catalogs through table providers.

## What changes are included in this PR?

Now that we have [trait
upcasting](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/) since
rust 1.86, we no longer need every implementation of these functions to
have the as_any function that returns &self. This PR makes Any an
supertrait and makes the appropriate casts when necessary.

## Are these changes tested?

Existing unit tests.

## Are there any user-facing changes?

Yes, the users simply need to remove the `as_any` function. The upgrade
guide is updated.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change Changes the API exposed to users of the crate core Core DataFusion crate documentation Improvements or additions to documentation ffi Changes to the ffi crate functions Changes to functions implementation logical-expr Logical plan and expressions optimizer Optimizer rules physical-expr Changes to the physical-expr crates proto Related to proto crate spark

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants